yjx.controller('createTeamController', ['$scope', '$timeout', '$fetch', 'modalService', '$state', '$init', function ($scope, $timeout, $fetch, modalService, $state, $init) {
    var api = '/group/create';
    var params = {}
    $scope.submit = function () {
        if($scope.title){
            params.name = $scope.title
        }
        if($scope.body){
            params.describe = $scope.body
        }
            $fetch.fetch(
                api,
                {
                    params: params,
                    type: 'post'
                }
            ).then(function(data){
                $scope.title='';
                $scope.describe='';
                $state.go('team',{},{reload:true})
            }).catch(function(e){
                $scope.title='';
                $scope.describe='';
                modalService.mainMsgError(e.msg);
            })
    }
   

}])